<template>
  <!-- 我的订阅新闻框 -->
  <div class ="subscribec" :class="'subscribec'+ subscribeId">
    <div class="subscribe-recommend">
        <!-- 新闻框标题 -->
        <a :name="'listA'+subscribeId"></a>
        <div class="subscribe-recommend-title">
            <span>{{subscribeTitle}}</span>
            <i class="open" @click="closeSub"></i>
        </div>
        <!-- 新闻框内容 -->
        <div class="subscribe-recommend-contents">
            <!-- 新闻框数据 -->
            <div class="contents-lists">
                <div class="contents-list" v-for="(value,index) in subscribeData" :key = "index"  v-if = "index < subscribeNum">
                    <navListDetComp :detailContent="subscribeData" @popContent="popContent"></navListDetComp>
                    <!-- <div class="contents-list-l">
                        <img src="../assets/test2.jpg" alt="新闻图">
                    </div>
                    <div class="contents-list-r">
                        <div class="contentsList-title">
                            <router-link to="/particulars">
                                <span class="red">{{value.listType}}：</span>
                                <span>{{value.listTitle}}</span>
                            </router-link>
                        </div>
                        <div class="contentsList-content">
                            <span>{{value.listContent}}</span>
                        </div>
                        <div class="contents-bottom">
                            <span class="contents-time">{{value.time}}</span>
                        </div>
                        <div class="contentIcon">
                            <i class="pl"></i>
                            <i class="sc"></i>
                            <i class="zan"></i>
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
        <!-- 查看更多 -->
        <div class="move" @click="moveClick">
            <span>点击查看更多</span>
            <i></i>
        </div>
    </div>
    <compIcon :compIconContent="compIconContent" v-if="compIconShow"></compIcon>
  </div>
</template>

<script>
import navListDetComp from '@/components/navDetails/navListDetComp'
import compIcon from '@/components/public/compIcon'

   export default {
     data () {
       return {
         'subscribeNum': 2, // 我的订阅数据控制条数
         'compIconContent': '',
          compIconShow: false
       }
     },
     props: [
       'subscribeData', // 我的订阅新闻框数据
       'subscribeTitle', // 我的订阅新闻框标题
       'subscribeId'
     ],
     methods: {
       closeSub: function (e) {
        e.target.parentNode.parentNode.parentNode.style.display = 'none'
       },
       moveClick: function () {},
       // 从contribution子组件传来的参数，用来处理
  		popContent (value) {
  			var that = this
  			that.compIconContent = value
  			that.compIconShow = true
  			setTimeout (function () {
  				that.compIconShow = false
  			},3000)
  		}
     },
     components: {
       'navListDetComp': navListDetComp,
       'compIcon': compIcon
     }
   }
</script>

<style>

</style>

